#ifndef CAPTION_WINDOW_H
#define CAPTION_WINDOW_H
#include <gtkmm-2.4/gtkmm.h>
#include <iostream>
#include <fstream>
#include <string>
class captionWindow : public Gtk::Window
{
	protected:
	std::string captionText;
	Gtk::Button captionImage;
	Gtk::Button captionAll;
	Gtk::Label clbl;
	Gtk::VBox windowBox;
	Gtk::HBox buttonBox;
	Gtk::Entry captionEntry;
	unsigned short ct;
	//ifstream configIn;
	//ofstream configOut;

	void ciClicked()
	{
		ct = CAPTION_WINDOW_SINGLE;
		setStringText();
		this->hide();
	}

	void caClicked()
	{
		ct = CAPTION_WINDOW_ALL;
		setStringText();
		this->hide();
	}

	inline void setStringText()
	{
		captionText = captionEntry.get_text();
	}

	public:

	static const unsigned short CAPTION_WINDOW_ALL = 1;
	static const unsigned short CAPTION_WINDOW_SINGLE = 2;

	captionWindow() : 

		clbl ("Enter Caption Text"),
		captionImage("Caption"),
		captionAll("Batch Caption")
	{
		
		
		this->add(windowBox);

		windowBox.pack_start(clbl);
		windowBox.pack_start(captionEntry);
		windowBox.pack_start(buttonBox);

		buttonBox.pack_start(captionAll);
		buttonBox.pack_start(captionImage);

		captionImage.signal_clicked().
			connect(sigc::mem_fun(*this,&captionWindow::ciClicked));

		captionAll.signal_clicked().
			connect(sigc::mem_fun(*this,&captionWindow::caClicked));

		captionAll.show();
		captionImage.show();
		clbl.show();
		captionEntry.show();
		buttonBox.show();
		windowBox.show();
	}

	int run()
	{
		this->show();
		return 0;
	}

	unsigned short getCaptionType()
	{
		return ct;
	}

	std::string getCaptionString()
	{
		return captionText;
	}
};
#endif
